import os
import cv2
from PIL import Image
import numpy as np

img_path = "C:\\Users\\jiangshan\\Desktop\\Lock3DFace-demo\\rgbd\\001_Kinect_FE_1RGBD\\01.png"

rgbd_img = Image.open(img_path)
rgbd = np.array(rgbd_img)

print(rgbd.shape)

rgb = rgbd[:, :, 0:3]
depth = rgbd[:, :, 3]

print(rgb.shape)
print(depth.shape)

rgb = cv2.cvtColor(rgb, cv2.COLOR_RGB2BGR)
cv2.imshow("rgb", rgb)
cv2.waitKey(0)